<template>
	<view class="page page-fill">
		<view class="header">
			<view v-if="userIsLogin">
				<image src="../../static/carousel/batmanvssuperman.png" class="face"></image>
			</view>
			<view v-else>
				<image src="../../static/icos/default-face.png" class="face"></image>
			</view>
		
		<view class="info-wapper" v-if="userIsLogin">
			<view class="nickname">
				{{userInfo.userInfo.username}}
			</view>
			<view class="nav-info">
				ID:{{userInfo.userInfo.email}}
			</view>
			</view>
			
			<view v-else>
				<navigator url="../registLogin/registLogin">
				<view class="nickname regist-login">
					注册/登录
				</view>
				</navigator>
			</view>
			
			
			
			<view class="set-wapper" v-if="userIsLogin">
				<navigator url="../meInfo/meInfo">
				<image src="../../static/icos/settings.png" class="settings"></image>
				</navigator>
			</view>
		
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userIsLogin: false,
				userInfo: {}
			}
		},
		onShow() {
				var me = this;
			var userInfo = uni.getStorageSync("globalUser");
			if (userInfo !=null && userInfo !="" && userInfo != "undefined") {
				me.userIsLogin = true;
				me.userInfo = userInfo;
				// console.log(userInfo);
				
			}else {
				me.userIsLogin = false;
			}
			
		},	
			
		methods: {
			
		}
	}
</script>

<style>
 @import url("me.css");
</style>
